package com.aifund.common.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 交易员策略
 */
@Entity
@SQLDelete(sql = "update exchange_man_tactics set delete = 1 where id = ?")
@Where(clause = "is_del = 0")
@Data
@EntityListeners(AuditingEntityListener.class)
public class ExchangeManTactics {

    @Id
    @GeneratedValue
    private Long id;

    //用户ID
    private Long userId;

    //交易所
    private Long exchangeId;

    //策略名
    private String strategyName;

    //策略图标
    private String tacticsIcon;

    //交易类别(现货/合约）
    private Integer tradeType;

    private String apiKey;

    private String apiSecret;


    //本位币
    private String baseCurrency;

    //状态
    private Integer status;

    //自动选择交易币
    private boolean autoSelectTransactionCurrency;

    //费用
    private BigDecimal fee;

    //交易方式
    private String meansOfTransaction;

    //交易介绍
    private String description;

    @CreatedDate
    @Column(name = "createTime",updatable = false,nullable = false)
    private Date createTime;

    @LastModifiedDate
    @Column(name = "updateTime",nullable = false)
    private Date updateTime;

    @Type(type = "org.hibernate.type.NumericBooleanType")
    private Boolean isDel = false;

}
